﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FindPublicKey.aspx.cs" Inherits="RenShiKaoQin.FindPublicKey" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
    <div>
    输入姓名：<asp:TextBox ID="tbName" runat="server" 
            EnableViewState="False" Width="100px"></asp:TextBox>和身份证号后四位<asp:TextBox
        ID="tbIDCard" runat="server" Width="100px"></asp:TextBox><asp:Button ID="btnSearch"
        runat="server" Text="查询" />
        <asp:HyperLink ID="HyperLink1" runat="server" Text="返回" 
            NavigateUrl="~/Account/Login.aspx" />
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" EnableViewState="False" 
            EmptyDataText="没有符合条件的数据">
        <Columns>
            <asp:BoundField DataField="FName" HeaderText="姓名" SortExpression="FName" />
            <asp:BoundField DataField="FPublicID" HeaderText="工作编码" 
                SortExpression="FPublicID" />
            <asp:BoundField DataField="DeptName" HeaderText="科室" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>" 
        
            
            SelectCommand="SELECT TEmployee.FName, TEmployee.FPublicID, TEmployee.FBirthday, TDictDept.FName AS DeptName FROM TEmployee INNER JOIN TDept ON TEmployee.FEmployeeID = TDept.FEmployeeID INNER JOIN TDictDept ON TDept.FDeptCode = TDictDept.FDeptCode WHERE (TEmployee.FName = @FName) AND (TDept.FValidDate = (SELECT MAX(FValidDate) AS Expr1 FROM TDept AS TDept_1 WHERE (FEmployeeID = TEmployee.FEmployeeID))) AND (TEmployee.FCardID LIKE '%' + @CardID)">
        <SelectParameters>
            <asp:ControlParameter ControlID="tbName" Name="FName" PropertyName="Text" 
                Type="String" />
            <asp:ControlParameter ControlID="tbIDCard" Name="CardID" PropertyName="Text" />
        </SelectParameters>
    </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
